/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Anthares
 */
@Embeddable
public class LigneCommandePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "COM_ID", nullable = false)
    private int comId;

    @Basic(optional = false)
    @NotNull
    @Column(name = "PROD_ID", nullable = false)
    private int prodId;

    public LigneCommandePK() {
    }

    public LigneCommandePK(int comId, int prodId) {
        this.comId = comId;
        this.prodId = prodId;
    }

    public int getComId() {
        return comId;
    }

    public void setComId(int comId) {
        this.comId = comId;
    }

    public int getProdId() {
        return prodId;
    }

    public void setProdId(int prodId) {
        this.prodId = prodId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) comId;
        hash += (int) prodId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LigneCommandePK)) {
            return false;
        }
        LigneCommandePK other = (LigneCommandePK) object;
        if (this.comId != other.comId) {
            return false;
        }
        if (this.prodId != other.prodId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Model.LigneCommandePK[ comId=" + comId + ", prodId=" + prodId + " ]";
    }
    
}
